<template>
	<view class="">
		<view v-for="(items, index) in lists" :key="items.id" @click="handleGoDetail(items)"
			:class="checkObj.id == items.id ? 'contact_checked' : ''"
			class="list_shadow u-back-white u-m-t-30 u-radius-10 u-p-t-22 u-p-r-28 u-p-b-26 u-p-l-26 list_shadow">
			<view class="u-flex">
				<u-image width="90" height="90" shape="circle" :src="items.head_img" mode="" />
				<view class="u-m-l-34 u-flex-col u-flex-1 el-ellipsis">
					<view class="u-flex u-col-bottom">
						<view class="u-font-30 font_weight_bold u-p-r-8">{{ items.name }}</view>
						<u-icon v-if="items.type == 1" size="32" class="u-p-r-8" color="#C8AF73FF" name="renzheng1"
							custom-prefix="custom-icon" />
						<u-icon v-if="items.is_company_user == 1" size="32" class="u-p-r-8" color="#f8494d" name="qiye1"
							custom-prefix="custom-icon" />
						<view class="font9ff u-font-26 el-ellipsis">{{ items.position }}</view>
					</view>
					<view class="font9ff u-m-t-16 u-font-26">{{ items.address }}</view>
					<view class="u-m-t-16">
						<u-tag v-for="(tagItem, tagIndex) in items.industry_names" :key="tagIndex" :text="tagItem"
							class="u-m-r-14" size="mini" mode="plain" color="#f5602b" bgColor="#fff"
							border-color="#f5602b" />
					</view>
				</view>
			</view>
		</view>
		<u-modal v-model="showModal" @confirm="confirm" :show-cancel-button="true" width="500" confirm-text="立即注册"
			:show-title="false" confirm-color="#3070F6FF">
			<view class="modal_slot-content u-flex-col u-row-center u-col-center">
				请先注册后交换名片
			</view>
		</u-modal>
		<u-modal v-model="showGoRecharge" confirm-text="充值" @confirm="integralConfirm" :show-cancel-button="true" :content="content">
		</u-modal>
	</view>
</template>

<script>

	/* import {
		getSingleIntegral
	} from "@/api/user.js" */
	export default {
		// props: ['lists'],
		props: {
			lists: {
				type: Array,
				default: () => []
			},
			type: {
				type: Boolean,
				default: false
			},
			hideChangeCard: {
				type: Boolean,
				default: false
			}
		},
		data() {
			return {
				toastTitle: {
					fontSize: "30rpx",
					fontWeight: "bold"
				},
				refuse: {
					background: '#999',
					color: '#fff',
					borderRadius: '12px'
				},
				agree: {
					background: '#3070F6',
					color: '#fff',
					borderRadius: '12px'
				},
				showModal: false,
				showTips: false,
				cardId: 0,
				text: ['交换名片将扣除10积分，', '是否确定交换？'],
				checkoutList: [],
				checkObj: {},
				userIntegral: 0,
				showGoRecharge: false,
				content: "当前积分不足，是否马上充值",
				globalConfig: uni.getStorageSync("globalConfig")
			}
		},
		methods: {
			handleGoDetail(items) {
				if (this.hideChangeCard) {
					this.checkObj = items
					this.$emit("handleCheckUser", items)
				} else {
					uni.navigateTo({
						url: `/pages/contactDetail/contactDetail?id=${items.id}`
					})
				}
			},
			changeCheckValue() {
				this.checkObj = {}
			},
			confirm() {
				uni.navigateTo({
					url: "/pagesB/register/register"
				})
			},
			integralConfirm() {
				uni.navigateTo({
					url: "/pages/Innovation/Innovation?type=2&back=findContact"
				})
			},
			cancel() {
				this.showTips = false
			}
		}
	}
</script>

<style lang="scss">
	.contact_checked {
		background-color: #F1F6F9FF;
		border: solid 1px #3070F6FF;
	}
	
	.list_shadow {
		box-shadow: 0px 5rpx 23rpx 3rpx rgba(153, 153, 153, 0.24);
	}
</style>
